import Vue from "vue"
import Router from "vue-router"


// //懒加载，需要用到该组件才会引入该组件
// const Home = ()=>import('./../views/home/Home.vue');
// const Category = ()=>import('./../views/category/Category.vue');
// const Cart = ()=>import('./../views/cart/Cart.vue');
// const Xiangqing = ()=>import('./../views/xiangqing/Xiangqing.vue');
// const ContentView = ()=>import('./../views/category/components/ContentView.vue');
// //用户中心
// const Mine = ()=>import('./../views/mine/Mine.vue');
// const UserCenter=()=> import('./../views/mine/children/UserCenter');
// const MyOrders=()=>import('./../views/mine/children/MyOrders');
// const Pay=()=>import('./../views/mine/children/children/Pay');
//  const PaySuccess=()=>import('./../views/mine/children/children/children/PaySuccess');

// // 引入组件相关
// const Order=()=>import('./../views/order/Order.vue');
// const Success=()=>import('./../views/order/children/Success.vue');
// const AddAddress=()=>import('./../views/order/children/children/AddAddress.vue');
// const EditAddress=()=>import('./../views/order/children/children/EditAddress.vue');

// //引入登录
// const Login=()=>import('./../views/login/Login.vue');
// const Regist=()=>import('./../views/regist/Regist.vue');

//引入一级组件
import Index from './../views/index/Index.vue'
import DashBoard from './../views/index/children/Dashboard'
import GoodsList from './../views/index/children/GoodsList'
import AddGoods from  './../views/index/children/AddGoods'
import EditGoods from  './../views/index/children/EditGoods'
import GongyingshangList from './../views/index/children/GongyingshangList'
import AddGongyingshang from  './../views/index/children/AddGongyingshang'
import EditGongyingshang from './../views/index/children/EditGongyingshang'
import MemberList from './../views/index/children/MemberList'  //会员列表
import MemberAdd from './../views/index/children/MemberAdd'  //会员添加
import YibanList from './../views/index/children/YibanList'   //一般投放柜
import XhList from './../views/index/children/XhList'   //鲜活投放柜

import OrderList from './../views/index/children/OrderList'
import CaigouList from './../views/index/children/CaigouList'
import PostInfo from './../views/index/children/children/PostInfo'
import Jifen from './../views/index/children/children/Jifen'
import Quanxian from './../views/index/children/children/Quanxian'
import OrderDetail from './../views/index/children/children/OrderDetail'
Vue.use(Router);

export default new Router({
	routes:[
        {path:'/',redirect:'/index/dashboard'},
        {
             path:'/index',
             name:'index',
             component:Index,
             children:[
                 {path:'dashboard',name:'dashboard',component:DashBoard},
                 {path:'goodslist',name:'goodslist',component:GoodsList},                 
                 {path:'addGoods',name:'addGoods',component:AddGoods}, 
                 {path:'editGoods',name:'editGoods',component:EditGoods},
                 {path:'gongyingshangList',name:'gongyingshangList',component:GongyingshangList},
                 {path:'addGongyingshang',name:'addGongyingshang',component:AddGongyingshang},    
                 {path:'editGongyingshang',name:'editGongyingshang',component:EditGongyingshang},     
                 {path:'memberList',name:'memberList',component:MemberList,children:[
                   {path:'jifen',name:'jifen',component:Jifen},
                   {path:'quanxian',name:'quanxian',component:Quanxian},
                   ]
                 },
                 {path:'memberAdd',name:'memberAdd',component:MemberAdd},  //添加会员
                 {path:'orderList',name:'orderList',component:OrderList,children:[
                    {path:'orderDetail',name:'orderDetail',component:OrderDetail},
                    {path:'postInfo',name:'postInfo',component:PostInfo}
                 ]
                },//会员列表
                {path:'yibanList',name:'yibanList',component:YibanList},  //一般投放柜
                {path:'xhList',name:'xhList',component:XhList},     //鲜活投放柜
                {path:'caigouList',name:'caigouList',component:CaigouList},
                                ]
         
         },



	]
})